<template>
	<view class="pr">
		<view class="coupon-box-item  df aic jcsb"
		:style="{'background-image':`url(${item.couponImg})`}"
			>
			<view class="info-box">
				<view class="fs24 cf type">{{couponTypeList[item.couponType]||''}}
				</view>
				<view class="fwb cf u-text-center"><text class="fs34">￥</text><text
						class="fs50">{{item.reduceMoney||0}}</text></view>
				<view class="fs26 cf u-text-center">满{{item.conditionMoney||0}}可用</view>
			</view>
			<view class="info-right">
				<view class="fwb  fs28  u-line-1 df aic jcsb" style="width:440rpx">
					<view class="u-line-1">{{item.couponTitle||''}}</view>
					<view class="fs24  fwb" v-if="confirm">
						{{item.isCanUse==0?'不可用':'可用'}}
					</view>
				</view>
				<view class="   mt15"><text class="fs24">发放后</text><text
						class=" fwb">{{item.effectiveDays||0}}</text><text class="fs24"> 天内有效</text></view>
				<view class="df aic jcsb">
					<view class=" fs24 handle" @click="selectOpen = !selectOpen">
						规则说明<u-icon class="handle--select ml10" :class="{'handle--select--reverse': selectOpen }"
							name="arrow-down" color="white"></u-icon>
					</view>

				</view>
			</view>
		</view>
		<view class="desc-box app-theme fs24" v-if="selectOpen">
			<text> {{item.introduce||''}}
			</text>
		</view>
		<template v-if="!confirm">
			<image src="../../../static/my/coupon/y.png" v-if="item.usedStatus==1" class="status-img"></image>
			<image src="../../../static/my/coupon/ygq.png" v-if="classIndex==2" class="status-img"></image>
			<image src="../../../static/my/coupon/dsy.png" v-if="classIndex==0" class="status-img"></image>
		</template>
	</view>
</template>

<script>
	export default {
		components: {},
		props: {
			item: {
				default: () => {},
				type: Object
			},
			classIndex: {
				default: 0,
				type: [Number, String]
			},
			confirm: {
				default: false,
				type: Boolean
			},
			
		},
		data() {
			return {
				selectOpen: false,
				// {{item&&item.couponType==1?'新客券':item&&item.couponType==2?'品类券':'单品券'}}
				couponTypeList:{
					'1':'新客单品券',
					'2':'品类券',
					'3':'单品券',
					'4':'新客品类券'
				}
			};
		},
		methods: {
			handlePush() {
				uni.navigateTo({
					url: '/CrmApplet/pages/discountCoupon/push'
				})
			}
		},
	};
</script>

<style lang="scss" scoped>
	.status-img {
		width: 85.63rpx;
		height: 75rpx;
		position: absolute;
		top: 26rpx;
		right: 40rpx;
	}

	.desc-box {
		padding: 20rpx;
		background: #F0F7FD;
		border-radius: 0 0 20rpx 20rpx;
		margin: 0 6rpx;
	}

	.coupon-box-item {
		width: 710rpx;
		height: 189rpx;
		background-size: 100%;
		background-repeat: no-repeat;
		background-size: 700rpx;
		height: 180rpx;
		background-position: 0rpx -15rpx;
		color: white ;


		.info-right {
			width: 495rpx;
		}

		.info-box {
			width: 195rpx;

			.type {
				padding: 10rpx 18rpx 0;
			}
		}
	}



	.handle {
		&--select {
			transition: transform 0.4s;

			&--reverse {
				transform: rotate(-180deg);
			}
		}
	}
	.price{
		color: #EF2929 !important;
	}
</style>